package com.android.pandoid.aidl.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Date: 2020/8/28 15:56
 * Author: Tatum
 * Description: TODO
 */
public class MessageBean implements Parcelable {
    private String content;
    private boolean isSend;

    @Override
    public String toString() {
        return "MessageBean{" +
                "content='" + content + '\'' +
                ", isSend=" + isSend +
                '}';
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isSend() {
        return isSend;
    }

    public void setSend(boolean send) {
        isSend = send;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.content);
        dest.writeByte(this.isSend ? (byte) 1 : (byte) 0);
    }

    public MessageBean() {
    }

    protected MessageBean(Parcel in) {
        this.content = in.readString();
        this.isSend = in.readByte() != 0;
    }

    public static final Parcelable.Creator<MessageBean> CREATOR = new Parcelable.Creator<MessageBean>() {
        @Override
        public MessageBean createFromParcel(Parcel source) {
            return new MessageBean(source);
        }

        @Override
        public MessageBean[] newArray(int size) {
            return new MessageBean[size];
        }
    };
}
